package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.EvaWorkExecutionService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrbff.common.util.RedisUtil;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.integration.FwAppEvaWorkExecutionClient;
import com.wicket.okrapp.integration.dto.BatchAddEvaTepCyclePlanRespDto;
import com.wicket.okrapp.integration.dto.BatchAddEvaTepCyclePlanReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrapp.integration.FwAppOffStateClient;
import com.wicket.okrapp.integration.dto.RefreshEvaThemeCurrentBstepRespDto;
import com.wicket.okrapp.integration.dto.RefreshEvaThemeCurrentBstepReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class EvaWorkExecutionServiceImpl implements EvaWorkExecutionService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  FwAppEvaWorkExecutionClient fwAppEvaWorkExecutionClient;
@Resource
  FwAppOffStateClient fwAppOffStateClient;
/**
   * B3-3新增评价模板安排周期相关(管理)[3099]
   * gen by moon at 10/19/2022, 6:44:40 AM
   */
    @Trace(operationName = "B3-3新增评价模板安排周期相关(管理)")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffAddEvaTepPlanCycleRespDto addEvaTepPlanCycle(BffAddEvaTepPlanCycleReqDto reqDto){
      
       
       //步骤0: D3-2批量增评价模板周期安排 - batchAddEvaTepCyclePlan
     BatchAddEvaTepCyclePlanRespDto batchAddEvaTepCyclePlanRespDto = null;
    BatchAddEvaTepCyclePlanReqDto batchAddEvaTepCyclePlanReqDto=new BatchAddEvaTepCyclePlanReqDto();
  if(reqDto!=null){
      batchAddEvaTepCyclePlanReqDto.setTargetId(reqDto.getTargetId());//SimpleFieldAssign//sourceId:178218_1
batchAddEvaTepCyclePlanReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:178219_1
    }
  
    /*D3-2批量增评价模板周期安排[2424]   */
    Assert.isNull(batchAddEvaTepCyclePlanReqDto.getTargetId(),"B3-3新增评价模板安排周期相关(管理)-D3-2批量增评价模板周期安排-冗余目标ID不能为空",false);
Assert.isNull(batchAddEvaTepCyclePlanReqDto.getEvaluationTemplateId(),"B3-3新增评价模板安排周期相关(管理)-D3-2批量增评价模板周期安排-归属评价模板ID不能为空",false);
      batchAddEvaTepCyclePlanRespDto = fwAppEvaWorkExecutionClient.batchAddEvaTepCyclePlan(batchAddEvaTepCyclePlanReqDto).getData();
      
      
      
    
BffAddEvaTepPlanCycleRespDto retData = new BffAddEvaTepPlanCycleRespDto();
  
  

  
  
return retData;
  }
  //
}
